package com.ep.thirdPlatformProject.erp.config;



import com.alibaba.fastjson2.annotation.JSONField;
import com.ep.thirdPlatformProject.erp.entity.ErpDataKey;
import com.ep.thirdPlatformProject.erp.entity.ErpHost;
import com.ep.thirdPlatformProject.erp.entity.ErpPayload;
import com.ep.thirdPlatformProject.erp.entity.ErpService;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "erp")
public class ErpConfig {

    /**
     * key
     */
    private String key;

    /**
     * 类型
     */
    private String type;


    /**
     * url地址
     */
    private String url;

    /**
     * host配置
     */
    @NestedConfigurationProperty
    private ErpHost host;


    /**
     * dataKey
     */
    @JSONField(name = "datakey")
    @JsonProperty("datakey")
    @NestedConfigurationProperty
    private ErpDataKey dataKey;


    /**
     * 服务
     */
    @NestedConfigurationProperty
    private ErpService service;


    /**
     * 有效载荷
     */
    @NestedConfigurationProperty
    private ErpPayload payload;

}
